package com.zhangwei.yueshijia.view.adapter;

import android.content.Context;

import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
import com.zhangwei.yueshijia.R;
import com.zhangwei.yueshijia.bean.home.GoodsSpecial;
import com.zhangwei.yueshijia.utils.ImageLoader;

/**
 * Created by zhangwei on 2016/11/24.
 */

public class GoodsSpecialAdapter extends SuperBaseAdapter<GoodsSpecial> {
    private Context context;


    public GoodsSpecialAdapter(Context context) {
        super(context);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder holder, GoodsSpecial item, int position) {
        holder.setText(R.id.item_goods_special_title, item.getGoodsName())
                .setText(R.id.item_goods_special_price, "¥ " + item.getGoodsPrice());
        ImageLoader.getSingleton().displayImage(item.getGoodsImg(), context, holder.getView(R.id.item_goods_special_img));
    }

    @Override
    protected int getItemViewLayoutId(int position, GoodsSpecial item) {
        return R.layout.item_goods_special_layout;
    }
}
